#include "listfile.h"
#include "ui_listfile.h"

#include <QStringList>

listfile::listfile(QDir dir, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::listfile),
    dir(dir)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::Dialog);
    this->setWindowModality(Qt::WindowModal);

    QStringList list =  dir.entryList();
    list.removeOne(".");
    list.removeOne("..");
    for(int i = 0; i < list.size(); i++)
    {
        ui->listWidget->addItem(list.at(i));
    }
}

listfile::~listfile()
{
    delete ui;
}

void listfile::setDir(const QDir &newDir)
{
    dir = newDir;
}



void listfile::on_listWidget_itemDoubleClicked(QListWidgetItem *item)
{

}

